package com.metal.gear.certification.entity.dto;



import com.metal.gear.common.annotation.Dict;
import com.metal.gear.common.constant.DateTimeConstant;
import com.metal.gear.common.util.query.QueryRule;
import com.metal.gear.common.util.query.QueryRuleEnum;
import com.metal.gear.common.util.query.SearchDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

@Data
@Schema(name ="用户查询条件实体")
public class UserSearchDto implements SearchDto {

    @Schema(name ="登录账号")
    @QueryRule(column = "username",queryCondition = QueryRuleEnum.LIKE)
    private String username;

    @Schema(name ="真实姓名")
    @QueryRule(queryCondition = QueryRuleEnum.LIKE)
    private String realname;

    @Schema(name ="生日")
    @DateTimeFormat(pattern = DateTimeConstant.DATE_FORMAT_HYPHEN)
    @QueryRule(queryCondition = QueryRuleEnum.GE,column = "birthday")
    private LocalDate birthdayStart;

    @Schema(name ="生日")
    @DateTimeFormat(pattern = DateTimeConstant.DATE_FORMAT_HYPHEN)
    @QueryRule(queryCondition = QueryRuleEnum.LE,column = "birthday")
    private LocalDate birthdayEnd;

    @Dict(dicCode = "sex")
    @Schema(name ="性别")
    @QueryRule(queryCondition = QueryRuleEnum.GE)
    private Integer sex;

    @Schema(name ="电子邮件")
    @QueryRule(queryCondition = QueryRuleEnum.LIKE)
    private String email;

    @Schema(name ="电话")
    @QueryRule(queryCondition = QueryRuleEnum.LIKE)
    private String phone;

    @Schema(name ="组织机构代码")
    @QueryRule(column = "depart_codes",queryCondition = QueryRuleEnum.SOME_ONE_IN)
    private String orgCode;

    @Schema(name ="组织机构名称")
    @QueryRule(column = "depart_names",queryCondition = QueryRuleEnum.SOME_ONE_IN)
    private  String orgCodeTxt;

    @Dict(dicCode = "user_status")
    @Schema(name ="账号状态(1：正常  2：冻结 ）")
    @QueryRule(queryCondition = QueryRuleEnum.EQ)
    private Integer status;

    @Schema(name ="工号")
    @QueryRule(queryCondition = QueryRuleEnum.LIKE)
    private String workNo;

    @Dict(dictTable ="sys_position",dicText = "name",dicCode = "code")
    @Schema(name ="职务")
    @QueryRule(queryCondition = QueryRuleEnum.EQ)
    private String post;

    @Schema(name ="座机号")
    @QueryRule(queryCondition = QueryRuleEnum.LIKE)
    private String telephone;

}
